package student;
/*3)、模拟三个老师同时分发30份笔试试卷，每个老师相当于一个线程。*/
public class Teachers implements Runnable{

    @Override
    public void run() {
        for (int i = 1; i < 31; i++) {

            System.out.println(Thread.currentThread().getName() + "在发第" + i + "份试卷");
        }
    }

    public static void main(String[] args) {
        Runnable runnable = new Teachers();
        Thread thread = new Thread(runnable,"牛哥");
        Thread thread1 = new Thread(runnable,"张政");
        Thread thread2 = new Thread(runnable,"强哥");
        thread.start();
        thread1.start();
        thread2.start();
    }
}
